<?php
namespace jianan\controllers;

use Yii;
use yii\web\Controller;
use jianan\models\Master;

class MasterController extends Controller {

	public function actionLogin(){

		// private $username = 'admin@heivr.com';
		// private $pass = '111111';
		// $name = $_POST['username'];
		// $password = $_POST['password'];
		
		if (isset($name) && isset($password)){
			if($name == $username && $password == $pass) {
				 $msg = 'login succeess';
				 $err = 0;
			} else {
				$msg = 'login fail';
				$err = 1;
			}
			$re = [
				'msg' => $msg,
				'err' => $err,
				'data' => []
			];
		}	
		return json_encode($re);
	}
}
{}